package com.zhuoshi.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zhuoshi.entity.Indent;
import com.zhuoshi.entity.Room;
import com.zhuoshi.mapper.IndentMapper;
import com.zhuoshi.mapper.RoomMapper;
import com.zhuoshi.service.IndentService;

@Service
public class IndentServiceImpl implements IndentService{

	@Autowired
	private IndentMapper indentMapper;
	
	@Autowired
	private RoomMapper roomMapper;
	
	@Override
	public List<Indent> showIndent() {
		// TODO Auto-generated method stub
		List<Indent> lists = indentMapper.selectByExample(null);
		for (Indent indent : lists) {
			Room room = roomMapper.selectByPrimaryKey(indent.getRoomid());
			indent.setRoomtotal(room.getRoomtotal());
			indent.setRoomprice(room.getRoomprice());
			indent.setNumber(room.getNumber());
		}
		return lists;
	
	}
	
}
